<!--
 * @Description: 首页-热门直播详情页面 -- hot_live
 * @Author: your name
 * @Date: 2023-12-14
 * @LastEditTime: 2023-12-14
 * @LastEditors: Please set LastEditors
-->

<template>
  <div>
    <div class="layout">
      <div class="handpick heart_w">
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item>
            FRM二级冲刺私播课-市场风险计量和管理00
          </el-breadcrumb-item>
        </el-breadcrumb>

        <div class="container_content">
          <div class="container_content_imagelist">
            <el-carousel
              trigger="click"
              height="336px"
              indicator-position="outside"
            >
              <el-carousel-item>
                <el-image
                  src="http://cremb-zsff.oss-cn-beijing.aliyuncs.com/da482202102051439146544.jpg"
                >
                </el-image>
              </el-carousel-item>
            </el-carousel>
          </div>

          <div class="container_content_message">
            <h3>{{ liveObj.title }}</h3>
            <!-- <h2 class="feigk">非公开</h2> -->
            <!-- <p
              style="
                height: 30px;
                line-height: 30px;
                font-size: 16px;
                color: #333;
              "
            >
              上课时间：2024年06月11日 18:00-20:00
            </p> -->
            <div class="message_dis">
              <span>课程亮点：</span>
              {{ liveObj.descript }}
            </div>
            <p class="content_y">
              讲师：<span>{{ liveObj.teacher }}</span>
            </p>
            <div class="handle">
              <div>
                <i class="iconfont icon-renyuan-05"></i>
                {{ liveObj.nums }}人预约
              </div>
              <div>
                <el-button type="primary" round @click="EnterTheLiveB">
                  {{ liveObj.button_text }}
                </el-button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="container heart_w">
      <div class="container_detils">
        <div class="detils_con">
          <!-- tabs栏 -->
          <div class="container_selectTap">
            <div class="selectTap_item">
              <div class="selectTap_tip">
                <img
                  src="http://zhishifufei.crmeb.net/pc/images/select.png"
                  alt=""
                />
              </div>
              <div class="selectTap">
                <!-- :key="item"
                v-for="(item, index) in 2" -->
                <!-- @click="tabsTitles(index)" -->
                <span>详情</span>
              </div>
            </div>
          </div>

          <div class="container_content_detils">
            <!-- 1. 详情 -->
            <div class="detils_content" v-if="baseId_img">
              <p>
                <img
                  src="https://video.rycfa.com/image/default/50E5B7E9F329493BA2C6B20B9FEE1A59-6-2.png"
                />
              </p>
            </div>

            <!-- 2. 目录 -->
            <!-- <div v-if="false">
              <div class="course_catalogue" v-for="item in 3" :key="item">
                <div class="playback-tag">回放</div>
                <div>
                  <span>
                    01 | 用编程语言探索科学奥秘，数据科学与机器学习详细攻略
                  </span>
                </div>
              </div>

              分页
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-size="pageSize"
                align="center"
                background
                :page-sizes="[5, 10, 16]"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total"
              >
              </el-pagination>
            </div> -->
          </div>
        </div>

        <!-- 推荐课程 -->
        <div class="detils_propaganda">
          <div class="propaganda_recommend">
            <div class="recommend_more">
              <div>相关公开课推荐</div>
              <div>更多<i class="el-icon-arrow-right"></i></div>
            </div>

            <div class="propaganda_con">
              <a
                href="#"
                v-for="item in openClassList"
                :key="item.id"
                @click="handpick_ck(item)"
              >
                <el-image :src="item.image"> </el-image>
                <div>
                  <div class="title">
                    {{ item.title }}
                  </div>
                  <div class="browse-money"></div>
                  <div class="label-count">
                    <div>781人预约</div>
                    <div
                      class="money"
                      style="
                        border: 1px solid #ff6b00;
                        padding: 5px;
                        border-radius: 23px;
                      "
                    >
                      <span>立即预约</span>
                    </div>
                  </div>
                </div>
              </a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getLiveInfo, getListByLike } from '@/api/hot_live'
export default {
  name: 'hot_live',
  data() {
    return {
      openClassList: [],
      rankId: 0,
      baseId_img: 1,
      img_active: 113,
      liveId: '',
      total: 30,
      currentPage: 1, // 当前页码默认值为1
      pageSize: 18, // 每页显示条数默认值为10
      liveObj: {}
    }
  },
  created() {
    this.liveId = this.$route.query.id
    console.log(this.$route.query)
    this.livesHot()

    getListByLike({ live_id: this.liveId }).then(({ data: data }) => {
      this.openClassList = data.data
    })
  },
  mounted() {},
  methods: {
    async livesHot() {
      const { data: data } = await getLiveInfo({ live_id: this.liveId })
      this.liveObj = data.data
    },
    EnterTheLiveB() {
      layer.msg('申请成功快去学习吧！')
      setTimeout(() => {
        this.$router.push({
          name: 'homes_tabs',
          query: { typeActiveName: '1' }
        })
      }, 1000)
      // this.$router.push({ path: '/newzhike/playback', query: {} })
    },
    tabsTitles(index, item) {
      this.rankId = index
      this.baseId_img = index
    },
    handpick_ck() {
      // 推荐课程
    },
    //切换分页大小
    handleSizeChange(size) {},
    //切换分页
    handleCurrentChange(current) {}
  }
}
</script>

<style scoped lang="scss">
@mixin a_global {
  .browse-money {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #666;

    .el-tag {
      height: 22px;
      padding-right: 9px;
      padding-left: 9px;
      border-color: rgba(44, 142, 255, 0.06);
      border-radius: 2px;
      background-color: rgba(44, 142, 255, 0.06);
      line-height: 20px;
      color: #2c8eff;
    }
  }

  .title {
    padding-top: 15px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 16px;
    color: #333;
  }
}

.el-breadcrumb {
  padding-top: 30px;
  padding-bottom: 20px;
}

.handpick {
  padding-bottom: 70px;
}

.layout {
  background-color: #ffffff;
}
.container_content {
  display: flex;
  background-color: #ffffff;

  ::v-deep .el-carousel__arrow {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}

.container_content_imagelist {
  width: 600px;
  margin-right: 30px;

  .el-image {
    width: 100%;
    height: 336px;
    border-radius: 8px;
  }
  ::v-deep .is-active button {
    height: 4px;
    border-radius: 3px;
  }
}

.container_content_message {
  flex: 1;
  h3 {
    color: #282828;
    font-size: 16px;
    line-height: 19px;
    font-weight: bold;
    padding-top: 11px;
    margin-bottom: 15px;
  }

  .feigk {
    color: #ff434b;
    font-size: 22px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
  }

  .message_dis {
    span {
      color: #666666;
      font-size: 14px;
    }
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #010101;
    font-size: 16px;
    line-height: 26px;
    margin-bottom: 15px;
  }

  .content_y {
    color: #010101;
    font-size: 15px;
    height: 100px;
    margin-bottom: 20px;

    span {
      padding: 10px;
      cursor: pointer;
      margin: 0 7px 7px 0;
      background: #f8f8f8;
      border-radius: 5px;
      font-family: PingFang SC;
      display: inline-block;
      font-weight: 500;
      font-size: 12px;
      color: #555;
    }
  }
}

.handle {
  display: flex;
  align-items: center;
  justify-content: space-between;

  div:first-child {
    font-size: 16px;
    color: #999999;
    cursor: pointer;
    display: flex;
    user-select: none;

    .iconfont {
      margin-right: 5px;
      font-size: 24px;
    }
  }

  div:last-child {
    .el-button {
      background: #fa4e4e;
      color: #fff;
      border: none;
      width: 140px;
      height: 45px;
      font-size: 16px !important;
    }

    .el-button.is-round {
      border-radius: 50px;
    }
  }
}

::v-deep .el-carousel__indicators {
  position: absolute;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 2;
}

::v-deep .el-carousel__indicators--horizontal {
  left: auto;
  right: 20px;
  bottom: 20px;
}

.container_detils {
  display: flex;
  margin-top: 30px;
}

.detils_con {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.container_selectTap {
  display: flex;
  margin-bottom: 10px;
  position: relative;
  height: 56px;
  border-radius: 2px;
  background-color: #fff;
  align-items: center;

  .el-button--text {
    padding: 2px 30px;
    border-left-color: #d9d9d9;
    border-radius: 0;
    color: #333333;
  }

  .el-button--text:hover {
    color: #409eff;
  }
}

.selectTap_tip {
  position: absolute;
  top: 0;
  left: 0;
  width: 113px;
  transition: 0.3s;

  img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
  }
}

.selectTap_item {
  display: flex;
  align-items: center;
  flex: 1;

  & > div:not(:last-child) {
    border-right: 1px solid #d9d9d9;
  }

  .selectTap {
    width: 113px;
    font-size: 14px;
    color: #282828;
    text-align: center;
    cursor: pointer;
    user-select: none;
  }
}

.container_content_detils {
  flex: 1;
  min-height: 0;
  background-color: #fff;
  border-radius: 5px;
  padding: 30px;
}

.detils_propaganda {
  width: 320px;
  margin-left: 14px;
}

.propaganda_recommend {
  background-color: #fff;
  padding: 0 14px;
  border-radius: 5px;
}

.recommend_more {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px dashed #f1f1f1;
  font-size: 18px;
  color: #282828;

  div:first-child {
    font-size: 18px;
    color: #282828;
  }

  div:last-child {
    color: #666;
    font-size: 12px;
    cursor: pointer;
  }
}

.propaganda_con {
  a {
    margin-bottom: 15px;
    display: block;
    border-radius: 8px;
    background-color: #fff;
    overflow: hidden;
    transition: 0.3s;

    .el-image {
      display: block;
      width: 100%;
      height: 160px;
    }

    .el-image + div {
      padding: 0 15px;
    }
  }

  .label-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
    border-top: 1px dashed #eee;
    font-size: 14px;
    color: #999;

    .money {
      font-size: 14px;
      color: #ff6b00;

      span {
        font-size: 14px;
      }
    }
  }

  @include a_global();
}

// ::v-deep .el-popover.phone-popper {
//   padding: 0 !important;
//   min-width: 0 !important;
// }

// ::v-deep .el-popover--plain {
//   padding: 0 !important;
// }

.el-popover {
  img {
    height: 140px;
    padding: 15px;
    box-sizing: border-box;
  }
  p {
    height: 29px;
    border-radius: 0 0 4px 4px;
    background-color: #2c8eff;
    font-size: 12px;
    line-height: 29px;
    text-align: center;
    color: #ffffff;
  }
}

/* 套餐 */
.package_course {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-row-gap: 14px;
  grid-column-gap: 14px;

  a {
    position: relative;
    margin-bottom: 15px;
    display: block;
    border-radius: 8px;
    background-color: #fff;
    overflow: hidden;
    transition: 0.3s;
    box-shadow: 0px 2px 15px rgb(79 109 143 / 15%);

    .el-image:first-child {
      display: block;
      width: 100%;
      height: 160px;
    }

    .el_img2 + div {
      padding: 0 15px;
    }

    .el_img2 {
      position: absolute;
      top: 130px;
      right: 10px;
      width: 12px !important;
      height: 12px;
      border-radius: 50%;
      padding: 4px;
      background-color: rgba(0, 0, 0, 0.5);
    }
  }

  .label-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
    font-size: 14px;
    color: #999;
  }

  @include a_global();
}

/* 练习 */
.problem {
  padding: 28px 0 0 27px;
  margin: -30px;

  .list {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
  }

  li {
    width: 390px;
    height: 180px;
    padding: 20px;
    list-style: none;
    box-sizing: border-box;
    border-radius: 8px;
    margin: 0 26px 26px 0;
    box-shadow: 0 2px 15px 1px rgb(79 109 143 / 15%);

    .wrap {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 25px;
      font-size: 14px;
      color: #999999;

      button {
        height: 30px;
        padding: 0 17px;
        border: none;
        border-radius: 15px;
        background-color: #2c8eff;
        font-size: 14px;
        color: #ffffff;
        cursor: pointer;
      }
    }

    .title {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      overflow: hidden;
      height: 54px;
      font-size: 18px;
      line-height: 27px;
      color: #282828;
    }

    ::v-deep .el-progress {
      margin-top: 12px;
      font-size: 14px;
      line-height: 20px;
      color: #2c8eff;
    }

    ::v-deep .el-progress-bar {
      display: inline-block;
      width: 180px;
      border-radius: 4px;
    }

    ::v-deep .el-progress__text {
      color: #2c8eff !important;
    }
  }
}

/* 考试 */
.question {
  padding: 30px 0 0 30px;
  margin: -30px;

  .list_question {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    list-style: none;

    li {
      width: 246px;
      height: 240px;
      border-radius: 8px;
      margin: 0 30px 30px 0;
      box-shadow: 0 2px 15px 1px rgb(79 109 143 / 15%);

      .el-image {
        display: block;
        width: 100%;
        height: 138px;
      }

      .title {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        padding: 15px 20px 0;
        font-size: 16px;
        line-height: 21px;
        color: #282828;
      }

      .group {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 20px 0;
        font-size: 14px;
        color: #ff6b00;

        .el-button {
          height: 26px;
          padding: 0 11px;
          border: none;
          border-radius: 13px;
          background-color: #2c8eff;
          font-size: 14px;
          color: #ffffff;
        }
      }
    }
  }
}

/* 目录 */
.course_catalogue {
  padding: 15px 0px;
  border-bottom: 1px dashed rgb(238, 238, 238);
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  font-size: 16px;

  .playback-tag {
    width: 30px;
    height: 16px;
    border: 1px solid #999999;
    margin-right: 10px;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    color: #999999;
  }

  .playback-tag + div,
  span {
    flex: 1;
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 21px;
    color: #333333;
  }
}

.el-pagination {
  padding: 50px 0 !important;
}

/* 详情 */
.detils_content {
  img {
    width: 100%;
  }
}
</style>
